﻿@model MvcShopping.Models.MemberLoginViewModel

<h2>會員登入</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>請輸入您的帳號、密碼</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.email)
        </div>
        <div class="editor-field">
            @*@Html.EditorFor(model => model.email)*@
            @Html.TextBoxFor(model => model.email, new { data_val_email = "請輸入 Email 地址" })
            @Html.ValidationMessageFor(model => model.email)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.password)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.password)
            @Html.ValidationMessageFor(model => model.password)
        </div>

        <p>
            <input type="submit" value="登入" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("回首頁", "Index", "Home")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")

    @if (TempData["LastTempMessage"] != null)
    {
    <script>    
        alert('@HttpUtility.JavaScriptStringEncode(Convert.ToString(TempData["LastTempMessage"]))');
    </script>
    }
}
